<?php
include "header.php";
$sql=mysql_query("select * from artical order by id asc");
?>
<style>
    td{line-height: 40px;}
    td a{color:#666};
</style>
<table align="center" style="padding-top: 15px">
    <thead>
    <th width="30">ID</th>
    <th width="50">栏目ID</th>
    <th width="100">标题</th>
    <th width="100">作者</th>
    <th width="120">版权</th>
    <th width="100">内容</th>
    <th width="100">插入时间</th>
    <th width="100">操作</th>
    </thead>
    <tbody>
    <?php
    while($a=mysql_fetch_array($sql)){
        ?>
        <tr>
            <td align="center"><?php echo $a['id'] ?></td>
            <td align="center"><?php echo $a['catagory'] ?></td>
            <td align="center"><?php echo $a['title'] ?></td>
            <td align="center"><?php echo $a['author'] ?></td>
            <td align="center"><?php echo $a['copyright'] ?></td>
            <td align="center"><?php echo substr_replace($a['content'],"...",50,-1); ?></td>
            <td align="center"><?php echo $a['addtime'] ?></td>
            <td align="center">
                <a href="javascript:if(confirm('确认要删除该内容么？'))location='artical.php?act=delete&id=<?php echo $a['id'] ?>'">删除</a>/
                <a href="javascript:if(confirm('确认要修改该内容么？'))location='artical.php?act=add&id=<?php echo $a['id'] ?>'">修改</a></td>
        </tr>

        <?php
    }
    ?>
    </tbody>
</table>

